package com.dongdongsongcan.app.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.dongdongsongcan.app.R;
import com.dongdongsongcan.app.control.bean.LabelData.Label;
import com.su.dolphin.adapter.DpBaseAdapter;
import com.su.dolphin.core.proxy.ImageLoader;

public class LabelAdapter extends DpBaseAdapter<Label> {

	public LabelAdapter(Context context) {
		super(context);
	}

	@Override
	public int onGetItemLayout() {
		return R.layout.layout_label_item;
	}

	@Override
	public void onGetView(View convertView, int position) {
		Label label = mDataList.get(position);
		ImageView main_item_label = findViewById(convertView,
				R.id.main_item_label);
		TextView main_item_label_title = findViewById(convertView,
				R.id.main_item_label_title);
		ImageLoader.i().loadImage(main_item_label, label.getImg());
		main_item_label_title.setText(label.getName());
	}

}
